package back.service.impl;

import back.mapper.BookMapper;
import back.pojo.Book;
import back.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;

    public List<Book> queryBookList(Book book) {
        return bookMapper.queryBookList(book);
    }

    public int getCountBook(Book book){
        return bookMapper.getCountBook(book);
    }

    public Book queryBookById(int id){
        return bookMapper.queryBookById(id);
    }

    public List<Book> queryBookByISBN(Book book) {
        return bookMapper.queryBookByISBN(book);
    }

    public void addBook(Book book){
        bookMapper.addBook(book);
    }

    public void updateBook(Book book){
        bookMapper.updateBook(book);
    }

    public void deleteBookById(int id) {
        bookMapper.deleteBookById(id);
    }

    public void deleteBook(List<Integer> ids){
        bookMapper.deleteBook(ids);
    }
}
